#ifndef BINARY_TREE_NODE_H
#define BINARY_TREE_NODE_H

// Define NULL if it hasn't already been
#ifndef NULL
#define NULL 0
#endif //NULL

template <class T> class BinaryTree; //超前声明

template<class T>
class BinaryTreeNode
{
private:
	BinaryTreeNode<T>* parentNode;
	BinaryTreeNode<T>* leftNode;
	BinaryTreeNode<T>* rightNode;
	T nodeKey;

	friend class BinaryTree<T>;
public:
	BinaryTreeNode();
	BinaryTreeNode(T key);
	~BinaryTreeNode();

};

//构造函数
template<class T>
BinaryTreeNode<T>:: BinaryTreeNode()
{
	parentNode = NULL;
	rightNode = NULL;
	leftNode = NULL;
	nodeKey=0;
}

template<class T>
BinaryTreeNode<T>:: BinaryTreeNode(T key)
{
	parentNode = NULL;
	rightNode = NULL;
	leftNode = NULL;
	nodeKey = key;
}

template<class T>
BinaryTreeNode<T>:: ~BinaryTreeNode(){}


#endif //BINARY_TREE_NODE_H
